﻿@using GoodMan.Infrastructure.Entities.Entity;
@using GoodMan.Infrastructure.Entities.Enum;
@{
    ViewBag.Title = "个人信息";
    Layout = "~/Areas/WorkSpace/Views/Shared/_FinancialOfficerTemplete.cshtml";

    GoodMan.Infrastructure.Entities.Entity.User userModel = ViewBag.UserModel;
    List<Dormitory> dormitoryList = ViewBag.DormitoryList;
}



@section head{
    <style type="text/css">
        .nav .active
        {
            /*background: url(<?php echo $this->img('manage_r2_c13.jpg');?>) no-repeat;*/
            background-color: #F5F5F5;
        }
        .nav .other
        {
            /* background: url(<?php echo $this->img('manage_r2_c14.jpg');?>) no-repeat;*/
            background-color: #E9E9E9;
        }
        h2.nav
        {
            border-bottom: 1px solid #B4C9C6;
            font-size: 13px;
            height: 25px;
            line-height: 25px;
            margin-top: 0px;
            margin-bottom: 0px;
        }
        h2.nav a
        {
            color: #999999;
            display: block;
            float: left;
            height: 24px;
            width: 113px;
            text-align: center;
            margin-right: 1px;
            margin-left: 1px;
            cursor: pointer;
        }
    </style>
}
    <link type="text/css" rel="Stylesheet" href="/content/css/select2.css" />
<div id="content-header">
    <h1>
        个人信息</h1>
</div>
<div id="breadcrumb">
    <a href="/homde/index" title="Go to Home" class="tip-bottom"><i class="icon-home"></i>首页</a>
    <a href="/workspace/FinancialOfficer/MyInfo" class="tip-bottom">个人资料</a> <a href="/workspace/FinancialOfficer/MyInfo" class="current">
        个人信息</a> <a href="#" class="current">修改/编辑</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-align-justify"></i></span>
                    <h5>
                        个人信息</h5>
                </div>
                <div class="widget-content nopadding">
                 @{
                     if (userModel != null)
                     {
                    <form id="regform" action="/workspace/FinancialOfficer/myinfo" method="post" name="regform" class="form-horizontal">
                    <div id="tab1">
                    <input type="hidden" name="page" value="@ViewBag.page" />
                    <input type="hidden" name="UserName" value="@userModel.UserName" />
                     
                        <div class="control-group">
                        <table border="0" style="width:80%">
                        <tr style="height:50px;">
                        <td style="width:80px; padding-right:20px;" align="right">
                                角色(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                                 <input type="text" class="span4 {required:true}"  class="span4" style="width: 250px"
                                    name="SystemRole"  readonly="readonly"  value="@userModel.SystemRole.Mapping()" />
                            </td>
                        <td style="width:80px; padding-right:20px;" align="right">
                                学院(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                                <input type="text" class="span4 {required:true}" class="span4" style="width: 250px"
                                    name="Departments"  value="@userModel.Departments" />
                            </td>
                        </tr></table>                          
                            
                        </div>
                        <div class="control-group">
                        <table border="0" style="width:80%">
                        <tr style="height:50px;">
                        <td style="width:80px; padding-right:20px;" align="right">
                                账 户(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                                 <input type="text"  name="UserName" style="width: 200px" 
                                    class="span4"   readonly="readonly" value="@userModel.UserName" />                            
                            </td>
                        <td style="width:80px; padding-right:20px;" align="right">
                                班 级(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                                    <input type="text"  name="Classes" style="width: 200px" 
                                    class="span4"  value="@userModel.Classes" />                      
                            </td>
                        </tr></table>  
                        </div>
                        <div class="control-group">
                        <table border="0" style="width:80%">
                        <tr style="height:50px;">
                         <td style="width:80px; padding-right:20px;" align="right">
                                性别(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                        <select name="Gender" id="Gender" style="width: 80px">
                               @{
                                    if (userModel.Gender == Gender.Male)
                         {
                                    <option value="1" selected="selected" >男</option>
                                    <option value="0" >女</option>
                         }
                                    else
                                    { 
                         <option value="1" >男</option>
                                    <option value="0" selected="selected" >女</option>
                                    }
                         
                                }
                                </select>
                                </td>
                        <td style="width:80px; padding-right:20px;" align="right">
                                 所属楼栋(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                        <select name="FloorId" id="FloorId" style="width: 150px;">
                                @{
                             if (dormitoryList != null && dormitoryList.Count != 0)
                             {
                                 string selectedStr = string.Empty;
                                 foreach (var item in dormitoryList)
                                 {
                                     if (item.Id == userModel.FloorId) { selectedStr = "selected=\"selected\""; } else {
                                         selectedStr = "";
                                     }
                                            <option value="@item.Id" @selectedStr>@item.Name</option>
                                            
                                 }
                             }
                                    }
                                </select>                     
                            </td>
                        </tr></table>  
                            
                        </div>
                        <div class="control-group">
                        <table border="0" style="width:80%">
                        <tr style="height:50px;">
                         <td style="width:80px; padding-right:20px;" align="right">
                                状态(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                                   
                                    @{
                         if (userModel.IsRefuse)
                         { <input type="text" name="IsRefuse" value="禁用" readonly="readonly" class="span4 {required:true}" style="width: 250px" />
 
                         }
                         else { 
                         <input type="text" name="IsRefuse" value="正常" readonly="readonly" class="span4 {required:true}" style="width: 250px" />

                         }
                                    } </td>
                        <td style="width:80px; padding-right:20px;" align="right">
                                寝室号(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                                <input type="text" class="span4" id="txtDormitory" class="span4 {required:true}" style="width: 250px"
                                    name="Dormitory"  value="@userModel.Dormitory"/>                        
                            </td>
                        </tr></table> 
                        </div>
                        <div class="control-group">

                        <table border="0" style="width:80%">
                        <tr style="height:50px;">
                        <td style="width:80px; padding-right:20px;" align="right">
                                真实姓名(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                                <input type="text" class="span4 {required:true}" id="txtrealName" name="RealName"
                                    style="width: 250px"  value="@userModel.RealName"/>
                            </td>
                        <td style="width:80px; padding-right:20px;" align="right">
                                联系电话1(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                                 <input type="text" value="@userModel.Phone" name="Phone" class="span4 {required:true}" style="width: 250px" />
                            </td>
                        </tr></table> 

                        </div>
                        <div class="control-group">
                        <table border="0" style="width:80%">
                        <tr style="height:50px;">
                        <td style="width:80px; padding-right:20px;" align="right">
                                昵称(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                                <input type="text" name="NickName"  value="@userModel.NickName" class="span4 {required:true}" style="width: 250px" />
                            </td>
                        <td style="width:80px; padding-right:20px;" align="right">
                                联系电话2(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                                  <input type="text" name="PhoneOne" value="@userModel.PhoneOne" class="span4 {required:true}" style="width: 250px" />
                              </td>
                        </tr></table> 

                        </div>
                       
                        <div class="control-group">
                        <table border="0" style="width:80%">
                        <tr style="height:50px;">
                        <td style="width:80px; padding-right:20px;" align="right">
                                身份证号(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                               <input type="text" class="span4 {number:true}" id="txtIdCardNo" class="span4 {required:true}" style="width: 250px"
                                    name="IdCardNo"  value="@userModel.IdCardNo"/></td>
                        <td style="width:80px; padding-right:20px;" align="right">
                                QQ(<font color="#ff0000">*</font>)</td>
                        <td style="width:30%" align="left">
                                   <input type="text" name="QQ" value="@userModel.QQ" class="span4 {required:true}" style="width: 250px" />
                           </td>
                        </tr></table>
                        </div>
                       
                    </div>
                    <div>
                     @{
                         if (ViewBag.Error != null)
                         {
                             if (ViewBag.Error == "")
                             { 
                            <div  class="alert alert-success"><strong style="width:50%; margin:0px auto">操作成功！</strong></div>
                             }
                             else
                             {
                            <div  class="alert alert-error"><strong  style="width:50%; margin:0px auto">@ViewBag.Error</strong></div>
                             }
                         }
                        }
                        <div class="form-actions">
                            <button type="submit" class="btn btn-primary">
                                保存</button>
                        </div>
                    </div>
                    </form>
                     }
                     }
                </div>
            </div>
        </div>
    </div>
</div>
@section tail{
    <script type="text/javascript" src="/Scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.metadata.js"></script>
    <script type="text/javascript" src="/Scripts/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript">
        var validation = new plug.BindValidCode();
        $(function () {
            validation.BindValidator();
            $('#datetimepicker').datetimepicker({
                pickTime: false
            });
            $('#regform').validate({
                errorClass: "help-inline",
                errorElement: "span",
                highlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').addClass('error');
                },
                unhighlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').removeClass('error');
                }
            });
        });
        function Refalsh(sender) {
            validation.Refalsh(sender);
        }
    </script>
<script type="text/javascript" src="/scripts/select2.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#likSelf').addClass('open');
            $('#likSelf').addClass('active');

            $('#FloorId').each(function () {
                $(this).select2();
            });

            $('#Gender').each(function () {
                $(this).select2();
            });
        });
    </script>
}
